import dayjs from 'dayjs';
import { downLoad, request } from '../../../request';

/** 导出 */
export function exportMoldMaintenance(params: any) {
  return downLoad({
    url: '/qms/agv/frock/mold/upkeep/record/export',
    params,
    method: 'get',
    fileName: `冲压模具维修保养明细${dayjs().format('YYYY-MM-DD HH:mm:ss')}.xlsx`
  });
}

/** 新增 */
export function addMoldMaintenance(data: any) {
  return request({
    url: '/qms/agv/frock/mold/upkeep/record/save',
    method: 'post',
    data
  });
}

/** 编辑 */
export function editMoldMaintenance(data: any) {
  return request({
    url: '/qms/agv/frock/mold/upkeep/record/update',
    method: 'post',
    data
  });
}

/** 获取模型下拉 */
export function getModelList(params: any) {
  return request({
    url: '/qms/agv/frock/mold/record/list',
    method: 'get',
    params
  });
}
export function deleteMold(id: any) {
  return request({
    url: `/qms/agv/frock/mold/upkeep/record/delete/${id}`,
    method: 'delete'
  });
}
